import {IProxy} from './IProxyStorage'
import {emit} from './Events'
export default class LocalStorage extends IProxy{
  setItem(key, value) {
    localStorage.setItem(key, value)
    emit(key,JSON.parse(value))
  }
  getItem(key,callback) {
    callback(localStorage.getItem(key))
  }
  removeItem(key) {
    localStorage.removeItem(key)
    emit(key,null)
  }
}
